package service.impl;

import dao.UserDao;
import dao.impl.UserDaoimpl;
import pojo.User;
import service.Userservice;

import java.util.List;

public class UserServiceimpl implements Userservice {
    UserDao userDao=new UserDaoimpl();
    public int addUser(User user){
        return userDao.addUser(user);
    }
    public List<User> findAll(User user, int offset, int pageSize){
        //TODO
        List<User> users = userDao.findAll(user, offset, pageSize);
        return users;
    }
    public User findById(Integer id){
        return userDao.findById(id);
    }

    @Override
    public int UpdateUser(User user) {
        return userDao.UpdateUser(user);
    }

    @Override
    public int DeleteUserById(Integer id) {
        return userDao.DeleteUserById(id);
    }

    @Override
    public int count(User user) {
        return userDao.count(user);
    }
}
